<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020/1/17
 * Time: 14:30
 */
namespace app\mtsuperadmin\controller;

use app\mtadminapi\model\MtShopHouse;
use app\util\ReturnCode;

/**
 * @todo
 * 房态管理
 * Class AdminSysHouseState
 * @package app\mtsuperadmin\controller
 */
class AdminSysHouseState extends Base
{
    public function houseList(){
        $p = intval($this->request->get("p")) ? intval($this->request->get("p")) : 1;
        $limit = intval($this->request->get("limit")) ? intval($this->request->get("limit")) : config("apiadmin.ADMIN_LIST_DEFAULT");
        $trem = $this->request->get("trem");
        if($trem){
            $where = [$trem,"=",$trem];
        }else{
            $where = "1=1";
        }
        $resData = (new MtShopHouse())->where($where)->page($p,$limit)->select();
        if($resData){
            return $this->bindError(ReturnCode::DB_READ_ERROR,"查询失败");
        }
        return $this->bindSuccess("查询成功",$resData);
    }
}